﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;

namespace Ruleweaver
{
	[TestFixture]
	public class DecimalFixture
	{
		[TestCase(0d, Result = true)]
		[TestCase(1d, Result = false)]
		[TestCase(2d, Result = true)]
		public bool IsEven(decimal n)
		{
			return Check.That(n).IsEven();
		}

		[TestCase(0d, Result = false)]
		[TestCase(1d, Result = true)]
		[TestCase(2d, Result = false)]
		public bool IsOdd(decimal n)
		{
			return Check.That(n).IsOdd();
		}

		[TestCase(-1d, Result = false)]
		[TestCase(0d, Result = false)]
		[TestCase(1d, Result = true)]
		public bool IsPositive(decimal n)
		{
			return Check.That(n).IsPositive();
		}

		[TestCase(-1d, Result = true)]
		[TestCase(0d, Result = false)]
		[TestCase(1d, Result = false)]
		public bool IsNegative(decimal n)
		{
			return Check.That(n).IsNegative();
		}

		[TestCase(-1d, Result = true)]
		[TestCase(0d, Result = true)]
		[TestCase(1d, Result = false)]
		public bool IsNotPositive(decimal n)
		{
			return Check.That(n).IsNotPositive();
		}

		[TestCase(-1d, Result = false)]
		[TestCase(0d, Result = true)]
		[TestCase(1d, Result = true)]
		public bool IsNotNegative(decimal n)
		{
			return Check.That(n).IsNotNegative();
		}

		[TestCase(-1d, Result = false)]
		[TestCase(0d, Result = true)]
		[TestCase(50d, Result = true)]
		[TestCase(100d, Result = true)]
		[TestCase(101d, Result = false)]
		public bool IsAdjustedPercentage(decimal n)
		{
			return Check.That(n).IsAdjustedPercentage();
		}

		[TestCase(-0.1d, Result = false)]
		[TestCase(0d, Result = true)]
		[TestCase(0.5d, Result = true)]
		[TestCase(1d, Result = true)]
		[TestCase(1.01d, Result = false)]
		public bool IsLiteralPercentage(decimal n)
		{
			return Check.That(n).IsLiteralPercentage();
		}
	}
}